package generator;

import misc.Vector3i;

public abstract class DungeonCell {
    protected Vector3i location;
    protected DungeonConstruct owner;
    
    @Deprecated
    protected DungeonCell() {}
    
    public DungeonCell(Vector3i location, DungeonConstruct owner) {
        this.location = location;
        this.owner = owner;
    }

    public Vector3i getLocation() {
        return location;
    }

    public void applyOffset(Vector3i offset) {
        location.add(offset);
    }
    
    public DungeonConstruct getOwner() {
        return owner;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DungeonCell other = (DungeonCell) obj;
        if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.location != null ? this.location.hashCode() : 0);
        return hash;
    }
}
